Changes to make snort3_demo more portable #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snort3 demo is having trouble running on my baseline Snort environment Krakatoa
This PR introduces a few small cleanups that improve portability of the snort3_demo environment.
My intention is to use the snort3_demo as the testing framework for Snort3 in all of my environments (Open and Private repos).
Prior to my changes running
run_tests.sh
failed 85 of 85 testAfter my changes, the tests pass 78 of 85 tests
My primary commit message follows
snort3_demo: Refactor run_test.sh script
This commit refactors the snort3_demo repository so that it can be executed
somewhat more portably, and ideally feels a bit more comfortable to the user.
These changes make one big assumption, namely:
snort and libdaq are installed to the default PREFIX directory
(/usr/local).
With this assumption made, the user is no longer responsible for
specifying the install location for "snorty", i.e.,
argv[1]
willnow specify the path of tests to execute.
NOTICE: If necessary, I will provide an override in the form of an
environment variable to restore specifying an alternate
install PREFIX.
Now argv[1] specifices the path to the "top" directory to search for,
and run tests from. The following commands are now all valid:
./run_tests.sh tests/ips_options
Runs all tests under "tests/ips_options/*"
./run_tests.sh tests/ips_options/so_and_soid
Runs the singular test under "tests/ips_options/so_and_soid/"
./run_tests.sh tests/ips_options/so_and_soid/test.bats
Identical to the previous exmaple, runs the singular test under
"tests/ips_options/so_and_soid/"
./run_tests.sh /root/alternate-path/some-private/integration-tests/
Runs all the tests under the user specified external directory.
The last major refactor to the script is the way which tests are
"searched and exected". Previously, the run_tests.sh used
find
tocreate a singular long command line argument of "directories" containing
the "tests.bat" script, passing it as an argument to a loop defined in
the same file.
The script is now chagned to use
find -exec run_one
, which isfunctionally equivalent, but is now future proofed from maxing out
command line arguments, or size of a command line in the given shell.
NOTICE: Acceptance of this PR will surely result in further refactorying
to make the environment more portable still.